package com.gxa.medical.service.impl;

import com.gxa.medical.mapper.DoctorTalkMapper;
import com.gxa.medical.pojo.Doctor;
import com.gxa.medical.pojo.Talk;
import com.gxa.medical.pojo.User;
import com.gxa.medical.service.DoctorTalkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Dusen
 * @date 2022/6/9 14:13
 */
@Service
@Transactional(rollbackFor = {Throwable.class})
public class DoctorTalkServiceImpl implements DoctorTalkService {
    @Autowired
    private DoctorTalkMapper doctorTalkMapper;


    @Override
    public Integer addTalk(Talk talk) {
        return doctorTalkMapper.addTalk(talk);
    }

    @Override
    public void addInviteDoc(Integer docId, Integer talkId) {
        doctorTalkMapper.addInviteDoc(docId, talkId);
    }

    @Override
    public void addDocTalk(Integer docId, Integer talkId) {
        doctorTalkMapper.addDocTalk(docId, talkId);
    }

    @Override
    public void addUserTalk(Integer userId, Integer talkId) {
        doctorTalkMapper.addUserTalk(userId, talkId);
    }


    @Override
    public Doctor selectDocAllByPhone(String phone) {
        return doctorTalkMapper.selectDocAllByPhone(phone);
    }

    @Override
    public List<Doctor> selectDocAllByHos(Integer hosId) {
        return doctorTalkMapper.selectDocAllByHos(hosId);
    }


    @Override
    public void updateTalkPeople(Integer talkId) {
        doctorTalkMapper.updateTalkPeople(talkId);
    }

    @Override
    public void addSignTalk(Integer docId, Integer talkId) {
        doctorTalkMapper.addSignTalk(docId, talkId);
    }

    @Override
    public List<User> selectUserAll() {
        return doctorTalkMapper.selectUserAll();
    }



    @Override
    public Talk selectTalk(Integer id) {
        return doctorTalkMapper.selectTalk(id);
    }


    @Override
    public List<Talk> selectDocTalk(Integer docId) {
        return doctorTalkMapper.selectDocTalk(docId);
    }

    @Override
    public List<Talk> selectAllTalk() {
        return doctorTalkMapper.selectAllTalk();
    }
}
